This adds a dummy help command so that it's usage can be documented with docopt!
Also adds help flags to all of the subcommands that were missing them. Without
that `cargo help sub-command` shows Invalid Argument before the usage text.
$macro!(fetch)
$macro!(generate_lockfile)
$macro!(git_checkout)
+ $macro!(help)
$macro!(locate_project)
$macro!(login)
$macro!(new)
}
docopt!(ConfigForKeyFlags, "
-Usage: cargo config-for-key --human --key=<key>
+Usage:
+ cargo config-for-key --human --key=<key>
+ cargo config-for-key -h | --help
+
+Options:
+ -h, --help Print this message
")
pub fn execute(args: ConfigForKeyFlags,
}
docopt!(ConfigListFlags, "
-Usage: cargo config-list --human
+Usage:
+ cargo config-list --human
+ cargo config-list -h | --help
+
+Options:
+ -h, --help Print this message
")
pub fn execute(args: ConfigListFlags,
docopt!(Options, "
Usage:
cargo git-checkout [options] --url=URL --reference=REF
+ cargo git-checkout -h | --help
Options:
-h, --help Print this message
--- /dev/null
+use docopt;
+
+use cargo::core::MultiShell;
+use cargo::util::{CliResult, CliError};
+
+docopt!(Options, "
+Get some help with a cargo command.
+
+Usage:
+ cargo help <command>
+ cargo help -h | --help
+
+Options:
+ -h, --help Print this message
+")
+
+pub fn execute(_: Options, _: &mut MultiShell) -> CliResult<Option<()>> {
+ // This is a dummy command just so that `cargo help help` works.
+ // The actual delegation of help flag to subcommands is handled by the
+ // cargo command.
+ Err(CliError::new("Help command should not be executed directly.", 101))
+}
Options:
--manifest-path PATH Path to the manifest to build benchmarks for
+ -h, --help Print this message
", flag_manifest_path: Option<String>)
#[deriving(Encodable)]
docopt!(Options, "
Usage:
- cargo clean [options] --manifest-path=PATH
+ cargo read-manifest [options] --manifest-path=PATH
+ cargo read-manifest -h | --help
Options:
-h, --help Print this message
docopt!(Flags, "
Usage:
cargo verify-project [options] --manifest-path PATH
+ cargo verify-project -h | --help
Options:
-h, --help Print this message